by Choosing Corporation (4 Submissions)
Category: Windows System Services
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Sat 16th December 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This code gets the hard-disk drive unit es. (c:\)
Dim wRet As Long
Dim wWinDir As String * 128
wRet = GetWindowsDirectory(wWinDir, 128)
GetWindowsDir = Left(Trim(wWinDir), wRet) + IIf(Right(wWinDir, 1) <> "\", "\", "")
End Function
Public Function HardDisk() As String
HardDisk = Left(GetWindowsDir, 3) ' Gets the first three charapters (c:\)
End Function